﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace EOS.Common
{
    public class ReflectionHelper
    {

        public static List<string> GetPropertyNames(string typeName)
        {
            string assemblyName = "EOS.DataModel";
            return GetPropertyNames(assemblyName, typeName);
        }
        
        private static List<string> GetPropertyNames(string assemblyName, string typeName)
        {
            object obj = Assembly.Load(assemblyName).CreateInstance(assemblyName + "." + typeName);
            PropertyInfo[] pInfos = obj.GetType().GetProperties();
            List<string> propertyNames = new List<string>();

            foreach (PropertyInfo info in pInfos)
            {
                propertyNames.Add(info.Name);
            }

            return propertyNames;
        }
    }
}
